LSP server#239
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
This was referenced Jul 16, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Confidence Score: 5/5
The PR is safe to merge — it adds a substantial new LSP server and IDE stack with no regressions to existing code paths.
All core paths — URI conversion, position encoding, diagnostics publishing, the shutdown handshake, and the VS Code lifecycle queue — are correctly implemented and well-covered by tests. The one behavioral edge case (inlay hints falling back to the whole file when a viewport range extends past the last line) is harmless in practice and does not affect correctness for any standard editor flow.
apps/lsp/src/handlers.rs — the inlay_hint range fallback is the only area worth a follow-up look before the feature ships to end users.
Important Files Changed
Sequence Diagram
%%{init: {'theme': 'neutral'}}%% sequenceDiagram participant Editor as VS Code Editor participant Client as LSP Client (client.ts) participant Server as inference-lsp (server.rs) participant Handler as handlers.rs participant IDE as AnalysisHost (ide/src/lib.rs) participant DB as RootDatabase (ide-db/src/database.rs) participant VFS as Vfs (vfs/src/lib.rs) Editor->>Client: activate extension Client->>Server: initialize (stdio) Server-->>Client: capabilities (FULL sync, hover, def, completion, symbols, hints) Editor->>Client: didOpen(uri, text) Client->>Server: textDocument/didOpen Server->>Handler: did_open(params) Handler->>IDE: open_document(path, text) IDE->>DB: open_document(path, text) DB->>VFS: set_contents(id, text) DB->>DB: invalidate dependent analyses Handler->>IDE: analysis().diagnostics(path) IDE->>DB: analysis(path) compute and memoize FileAnalysis DB-->>IDE: FileAnalysis IDE-->>Handler: Vec Diagnostic Handler-->>Server: PublishDiagnosticsParams plus dependents Server->>Client: textDocument/publishDiagnostics x N open docs Editor->>Client: hover request Client->>Server: textDocument/hover Server->>Handler: hover(params) Handler->>IDE: analysis().line_index(path) Handler->>IDE: analysis().hover(path, offset) IDE-->>Handler: Option Hover Handler-->>Server: Option Hover Server-->>Client: result Editor->>Client: didClose(uri) Client->>Server: textDocument/didClose Server->>Handler: did_close(params) Handler->>IDE: close_document(path) IDE->>VFS: remove_contents(id) Handler-->>Server: empty PublishDiagnosticsParams Server->>Client: textDocument/publishDiagnostics clear diagnostics%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%% sequenceDiagram participant Editor as VS Code Editor participant Client as LSP Client (client.ts) participant Server as inference-lsp (server.rs) participant Handler as handlers.rs participant IDE as AnalysisHost (ide/src/lib.rs) participant DB as RootDatabase (ide-db/src/database.rs) participant VFS as Vfs (vfs/src/lib.rs) Editor->>Client: activate extension Client->>Server: initialize (stdio) Server-->>Client: capabilities (FULL sync, hover, def, completion, symbols, hints) Editor->>Client: didOpen(uri, text) Client->>Server: textDocument/didOpen Server->>Handler: did_open(params) Handler->>IDE: open_document(path, text) IDE->>DB: open_document(path, text) DB->>VFS: set_contents(id, text) DB->>DB: invalidate dependent analyses Handler->>IDE: analysis().diagnostics(path) IDE->>DB: analysis(path) compute and memoize FileAnalysis DB-->>IDE: FileAnalysis IDE-->>Handler: Vec Diagnostic Handler-->>Server: PublishDiagnosticsParams plus dependents Server->>Client: textDocument/publishDiagnostics x N open docs Editor->>Client: hover request Client->>Server: textDocument/hover Server->>Handler: hover(params) Handler->>IDE: analysis().line_index(path) Handler->>IDE: analysis().hover(path, offset) IDE-->>Handler: Option Hover Handler-->>Server: Option Hover Server-->>Client: result Editor->>Client: didClose(uri) Client->>Server: textDocument/didClose Server->>Handler: did_close(params) Handler->>IDE: close_document(path) IDE->>VFS: remove_contents(id) Handler-->>Server: empty PublishDiagnosticsParams Server->>Client: textDocument/publishDiagnostics clear diagnosticsReviews (2): Last reviewed commit: "more tests" | Re-trigger Greptile
Context used: